<%--
  Created by IntelliJ IDEA.
  User: 12994
  Date: 2022/4/15
  Time: 20:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>购物车</title>
</head>
<body>

<h2 style="font-max-size: xxx-large; color:orange"  align="center" >这里是尊贵的${username.username}的购物车</h2>

<%--<c:if test="${Goods==null}">--%>

<h2 style="font-max-size: xxx-large; color:#b51dd7" align="center" >
    <a href= "shopping.jsp" />>返回购物</a>
</h2>


<%--<c:if test="${empty goods }">--%>
    <c:if test="${empty cartlist}">
    <h2 style="font-max-size: xxx-large; color:orange"  align="center" >
        购物车里啥也没有，赶紧去<a href="shopping.jsp" style="color: red">商城</a>添加吧
    </h2>
</c:if>

<c:if test="${cartlist.size()>0 }">
    <table cellspacing="0" align="center" border="1" width="800px" >
        <tr style="color: red">
            <th>商品编号</th>
            <th>商品名称</th>
            <th>商品价格</th>
            <th>商品介绍</th>
            <th>商品数量</th>
            <th>加购商品</th>
            <th>减少商品</th>
            <th>删除商品</th>
        </tr>
        <c:forEach items="${cartlist}" var="cartgoods">
            <tr align="center" style="color:purple">
                <td>${cartgoods.goods.id}</td>
                <td>${cartgoods.goods.name}</td>
                <td>${cartgoods.goods.price}</td>
                <td>${cartgoods.goods.about}</td>
                <td>${cartgoods.allgoodsnum}</td>

                <td><a href="addgoods?num=${cartgoods.allgoodsnum}" style="color: mediumblue">增加商品</a></td>
                <td><a href="reducegoods?num=${cartgoods.allgoodsnum}" style="color: mediumblue">减少商品</a></td>

                <td><a href="delete?id=${cartgoods.goods.id}" style="color: mediumblue">删除商品</a></td>
            </tr>
        </c:forEach>
    </table>
</c:if>
</body>
</html>
